﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace ISRecord.View
{
    public class BooleanConverter:IValueConverter
    {
        const string YES = "نعم";
        const string NO = "لا";
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            bool b = (bool)value;
            if (b == true)
            {
                return YES;

            }
            else
            {
                return NO;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string s = value.ToString();
            if (s.Trim().Equals(YES))
            {
                return true;
            }
            else
            {
                return false;
            }
            
        }
    }
}
